﻿using System.Windows.Forms;
using OhioState.Graphics;
using OhioState.Graphics.Proxy;

namespace OhioState.Controls
{
    public partial class NewTextureControl : UserControl
    {
        public NewTextureControl()
        {
            InitializeComponent();
            imageFormatControl.DataSource = System.Enum.GetValues(typeof(OhioState.Graphics.ImageFormat));
            byteFormatControl.DataSource = System.Enum.GetValues(typeof(OhioState.Graphics.ByteFormat));
        }

        public ITexture CreateTexture()
        {
            TexelFormat texelFormat = new TexelFormat();
            texelFormat.Format = (ImageFormat)imageFormatControl.SelectedValue;
            texelFormat.Type = (ByteFormat)byteFormatControl.SelectedValue;
            LayerTextureProxy texture = new LayerTextureProxy(nameControl.Text, (int)widthControl.Value, 
                (int)heightControl.Value, texelFormat);
            return texture;
        }
    }
}
